package net.redxyz.repost.resource.action;

import net.redxyz.top.dbo.sys.SysApp;

import org.zhiqim.httpd.HttpRequest;
import org.zhiqim.httpd.context.core.Action;
import org.zhiqim.orm.ORM;
import org.zhiqim.orm.ZTable;
import org.zhiqim.orm.dbo.Selector;

/**
 * 商家客户端接入登录失败
 * 
 * @version v7.0.1 @author lgz 2021-10-20 新建与整理
 */
public class OpenAppLoginErrAction implements Action
{
    
    @Override
    public void execute(HttpRequest request) throws Exception
    {
        long appKey = request.getParameterLong("id");
        
        SysApp app = null;
        if (appKey > -1)
            app = ORM.get(ZTable.class).item(SysApp.class, new Selector("appKey", appKey));
        
        if (app == null)
        {
            request.setAttribute("message", "未知授权客户端");
            return;
        }
        
        if (app.getAppStatus() == 1)
        {// 商家客户端已关闭
            request.setAttribute("message", "商家客户端已关闭");
            return;
        }
    }
    
}
